Repository navigation
Conversation
…isreads unaligned chunks (#3217) dpkt 1.9.8 pads DATA chunks alone, so it misplaces the chunks after any other unaligned one and decodes no SCTP layer where one ends the packet. toolkit.dpkt._sctp_chunks walks such a packet again from its octets, padding every chunk to four octets (RFC 9260 section 3.2), and the adapter feeds the records the default engine does wherever that engine decodes the SCTP layer. The engines page's DPKT row keeps the gap left, behind VLAN tag stacks dpkt misplaces the layers behind (#1646), and names the packets the default engine refuses for a last chunk cut inside its padding, whose DATA records DPKT still reads.
JarryShaw
force-pushed
the
feat/3217-dpkt-sctp-padding
branch
from
November 29, 2026 08:21
da027bc to
fda3ad5
Compare
Owner
Author
|
Good to go at
|
Contributor
|
Coverage: 94.97% (unit tier, Python 3.15,
Per-file detail: the |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please follow the guide below
Put an
xinto every box [ ] that applies to your pull request (like this: [x])Use the Preview tab to see how your pull request will look
Searched for similar pull requests
Followed the coding style (
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeDescribed the user-visible change below and left its changelog entry to the maintainer, keeping
docs/source/changelog/andCHANGELOG.mdout of the diff, if the change is user-visible: N/A — centralisedWhat is the purpose of your pull request?
Tick the commit type your subject line carries.
fix— corrects a defectfeat— adds a featureperf— changes performance, not behaviourrefactor— changes neither behaviour nor performancetest— tests onlydocs— documentation onlyci— workflows or build toolingrelease— bumps the version or rolls up a distributionchore— anything elseAlso tick if it regenerates constant or registry tables, members keeping their numeric values (the
constlabel)Description of your pull request and other information
Closes #3217.
toolkit.dpkt._sctp_chunksthen walks the chunks again from the SCTP octets, each padded to four octets (RFC 9260 §3.2) and stopping at a Length below the chunk header, as the default engine's chunk list does; the records are thentoolkit.pcap.sctp_reassembly's wherever that engine decodes the SCTP layer._sctp_carrierreturns kept octets, but not a later fragment's.Tests: the issue's three frames (an unaligned last I-DATA fragment, unaligned I-DATA then DATA, a Length-5 HEARTBEAT then DATA), the walk's edge cases and the gap join the #3188 table, now compared with the default engine;
CAPTURE's unaligned I-DATA fragments make the DPKT engine complete a message end to end. They fail on anorigin/developexport; the SCTP adapter code is at 100% statement and branch coverage. The #1739 sweep'sUNRELATEDlists the common header's 12 octets fortoolkit/dpkt.py.tests/toolkit,tests/foundation,tests/project,tests/protocols/*.pyandtests/*.pypass, and the Sphinx-gatedtests/projectmodules in a fresh docs venv.